package com.d0324;
import com.d0316.Calculator;

import javax.xml.bind.SchemaOutputResolver;
import java.util.Calendar;
import java.util.Date;

public class DataTest {
    public static void main(String[] args) {
        //获取现在的时间
        Date date1=new Date();
        System.out.println(date1);

        //Date date = new Date(10 * 24 * 60 * 60 * 1000);
        //System.out.println(date);
        //距离1970.1.1  8点  至此刻的毫秒数
        //System.out.println(System.currentTimeMillis());

        //抽象类不能够直接实例化
        Calendar calendar=Calendar.getInstance();//用getInstance方法实例化
        calendar.set(Calendar.YEAR,2035);
        calendar.set(Calendar.MONTH,2);
        System.out.println(calendar.get(Calendar.MONTH)+1);//Month从0开始要加1
        calendar.add(Calendar.YEAR,1);
        System.out.println(calendar.getTime());
    }
}
